package com.googlecode.tracey.ui.core;

import java.util.List;

public class SequenceDiagramGenerator {

    private final PlantUmlMarkupGenerator plantUmlMarkupGenerator;
    private final PlantUmlSequenceDiagramGenerator plantUmlSequenceDiagramGenerator;

    public SequenceDiagramGenerator(PlantUmlMarkupGenerator markupGenerator, PlantUmlSequenceDiagramGenerator plantUmlSequenceDiagramGenerator) {
        this.plantUmlMarkupGenerator = markupGenerator;
        this.plantUmlSequenceDiagramGenerator = plantUmlSequenceDiagramGenerator;
    }

    public String generateSequenceDiagram(List<TraceyMessage> messages) {
        return plantUmlSequenceDiagramGenerator.createSvg(plantUmlMarkupGenerator.collectPlantUmlMarkup(messages));
    }
}